<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .red {
            color: rgb(238, 8, 8);
        }

        .f60 {
            font-size: 60px;
        }
    </style>
</head>
<!-- v-bind 指令，动态绑定到 class 上面 -->
<body>
    <div id="app">

        <div>
            <!-- 原始写法 -->
            <h1 class="red">{{ msg }}</h1>
            <p>------------------------</p>

            <!-- 使用 bind 指令 -->
            <h1 :class="classArg"> {{ msg }} </h1>
            <p>------------------------</p>

            <!-- <p class="{类名1: 布尔值, 类名2: 布尔值, 类名2: 布尔值}"></p> -->
            <p :class="{red: isRed, f60: isF60}">{{msg}}</p>


            <button @click="change">点击切换</button>
        </div>
    </div>
    <script src="js/vue.js"></script>

    <script>
        const HelloVue = {
            data(){
                return {
                    msg : ' Holle Holle ',
                    classArg : 'red',
                    isRed : true,
                    isF60 : true
                }
            },
            methods: {
                change(){
                    this.isF60 = !this.isF60;
                    this.isRed = !this.isRed;
                }
            }
        };

        const app = Vue.createApp(HelloVue).mount("#app");
       
    </script>
</body>
</html>